<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@page import="com.portlet.service.quycachSPLocalServiceUtil"%>
<%@page import="com.portlet.model.*"%>
<%@page import="java.util.*" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<%@ taglib uri="http://alloy.liferay.com/tld/aui" prefix="aui" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page pageEncoding="UTF-8" %>
<portlet:defineObjects />
<h4> Trang quan ly cac quy cach san pham</h4>
<%
	int count=quycachSPLocalServiceUtil.getquycachSPsCount();
	List<quycachSP>list=quycachSPLocalServiceUtil.getquycachSPs(0, count);
	if(list.size()>0){
%>
	<portlet:actionURL name="editQC" var="actionQCURL"></portlet:actionURL>
	<h4>Danh sach quy cach</h4>
	<table border="1">
		<tr>
			<th>Ma quy cach</th>
			<th>Ten quy cach</th>
			<th>Delete</th>
		</tr>
		<%for (quycachSP l : list) { %>
		<tr>
			<td>
			<%
				String pk=String.valueOf(l.getMaQC());
			%>
				<aui:form action="<%=actionQCURL.toString() %>" method="post">
					<aui:input type="hidden" name="maQC" id="maQC" value="<%=l.getMaQC() %>"/>
					<aui:input type="submit" name="" value="<%=l.getMaQC() %>" />
				</aui:form>
				
			</td>
			<td><%=l.getTenQC() %></td>
			<td>
				<portlet:actionURL var="deleteURL" name="deleteQC">
					<portlet:param name="edit1" value="<%=pk %>"/>
				</portlet:actionURL>
				<liferay-ui:icon-delete url="<%=deleteURL.toString() %>" />
			</td>
		</tr>
		<%} %>
	</table>
<%}else{ %>
	<h5>Khong co du lieu nao!!</h5>
<%} %>
<portlet:renderURL var="addQuyCachSPURL">
	<portlet:param name="mvcPath" value="/addQC.jsp"/>
</portlet:renderURL>
<portlet:renderURL var="viewQCNLURL">
	<portlet:param name="mvcPath" value="/viewNLQC.jsp"/>
</portlet:renderURL>
<p>
	<a href="<%=addQuyCachSPURL%>">Them Quy Cach</a>
	<a href="<%=viewQCNLURL%>">Them chi tiet Quy cach</a>
</p>